import Vue from 'vue'
import Router from 'vue-router'
const Index = () => import('../views/index/index')
const Main = () => import('../views/main')

Vue.use(Router)
export default new Router({
  // mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Main',
      redirect: '/',
      components: {
        default: Main
      },
      children: [
        {
          path: '/',
          name: 'Index',
          components: {
            default: Index
          }
        },
        {
          path: '/article',
          name: 'ArticleList',
          components: {
            default: () => import('../views/article/list')
          }
        },
        {
          path: '/article/:id',
          name: 'ArticleDetail',
          components: {
            default: () => import('../views/article/detail')
          }
        },
        {
          path: '/tag',
          name: 'Tag',
          components: {
            default: () => import('../views/tag/index')
          }
        }
      ]
    },
    {
      path: '/admin',
      name: 'Admin',
      components: {
        admin: () => import('../views/admin/index')
      }
    },
    {
      path: '/editor',
      name: 'Editor',
      components: {
        admin: () => import('../views/admin/editor')
      }
    },
      {
          path: '/github-sign',
          name: 'githubSign',
          components: {
              admin: () => import('../views/login-cb/github')
          }
      }

  ]
})
